package cn.wjh.business.controller;

import cn.wjh.business.utils.IpAddressParser;
import com.ruoyi.common.core.domain.AjaxResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/business/ip")
public class IpController {
    @GetMapping("/addressTo")
    public AjaxResult getIpAddressToByIp(String ip) {
        String ipString = IpAddressParser.parse(ip);
        AjaxResult result = AjaxResult.success();
        result.put("data", ipString);
        return result;
    }
}
